import request from '@/utils/request'

// 查询非生产物料信息列表
export function listIqmMstr(query) {
  return request({
    url: '/project/iqmMstr/list',
    method: 'get',
    params: query
  })
}

// 查询非生产物料信息详细
export function getIqmMstr(itmId) {
  return request({
    url: '/project/iqmMstr/' + itmId,
    method: 'get'
  })
}

// 新增非生产物料信息
export function addIqmMstr(data) {
  return request({
    url: '/project/iqmMstr',
    method: 'post',
    data: data
  })
}

// 修改非生产物料信息
export function updateIqmMstr(data) {
  return request({
    url: '/project/iqmMstr',
    method: 'put',
    data: data
  })
}

// 删除非生产物料信息
export function delIqmMstr(itmIds) {
  return request({
    url: '/project/iqmMstr/' + itmIds,
    method: 'delete'
  })
}

// 导出非生产物料信息
export function exportIqmMstr(query) {
  return request({
    url: '/project/iqmMstr/export',
    method: 'get',
    params: query
  })
}

export function getIqmMstrByPm(query) {
  return request({
    url: '/project/iqmMstr/selectName',
    method: 'get',
    params: query
  })
}

//上传物料图片
export function uploadImg(data) {
  return request({
    url: '/project/iqmMstr/iqmImageUpload',
    method: 'post',
    data: data
  })
}

/** 根据物料品名 获取非生产物料 代码、品名规格、金额 */
export function getIqmByPmgg(query) {
  return request({
    url: '/project/iqmMstr/getIqmByPmgg',
    method: 'get',
    params: query
  })
}


